<body>
<script>
if (self==top) window.open("?op=core&fp=logout","_top");
</script>

<link href="/tpl/static/bootstrap/css/bootstrap.css?ver=1221" rel="stylesheet" type="text/css">
<link href="/tpl/static/webetblue/css/total_game.css?version=02011" rel="stylesheet" type="text/css"/>
<script src="/tpl/static/js/jquery.3.1.1.min.js?ver=0227"></script>
<script src="/tpl/static/bootstrap/js/bootstrap.min.js"></script>

<div class="container-fluid">
	<div class="row">
		<div class="col-sm-12" style="padding: 15px 15px;">
			<table border="0" cellpadding="2" cellspacing="1" width="95%" class=table0>
				<tr>
					<td class=td0 style="background-color: #005982;">{betname} 下注单</td>
				<tr>
					<td class=td2>
						<table border="0" cellpadding="2" cellspacing="0" width="100%">
							<tr>
								<td>{{L_ACCOUNT}}</td>
								<td align="right">{account}</td>
							</tr>
							<tr>
								<td>额度：</td>
								<td align="right">{amount}</td>
							</tr>
							<tr>
								<td>已用额度：</td>
								<td align="right">{usedamount}</td>
							</tr>
							<tr>
								<td>下注期数：</td>
								<td align="right">{round}</td>
							</tr>
							<tr>
								<td>开奖日期：</td>
								<td align="right">{open}</td>
							</tr>
						</table>
						<hr><center>
						<font color=red>{betname}</font> @
						<font color=red><b id="odds">{rate}</b></font>
						<form name="f" id="f" action="{action}" method="post" onSubmit="return chk(this)">
							<input type=hidden name=oldrate value="{rate}">
							<table border=0>
								{message}
								<tr>
									<td>盘类：</td>
									<td align="right" style="color:#006400;font-weight: bold;">{diskStr}</td>
								</tr>
								<tr>
									<td>下注金额：
									<td><input name="money" size=10 maxlength=8 value="{money}"
											   onkeypress="return KeyNumber()"
											   onkeyup="calculate();//nmoney.innerText=n2c(this.value);">
								<tr>
									<td>可赢金额：
									<td id="payoff" style="color:red" align="right">0</td>
								<tr>
									<td>最低限额：</td>
									<td align="right"><b>{min}</b></td>
								</tr>
								{oneamount}
								<tr>
									<td>下注限额：</td>
									<td align="right"><b>{amount2_str}</b></td>
								</tr>
								<tr>
									<td colspan=2 align=center>
										<input type=button name=cancel class="btn btn-default" style="height: 25px; width: 35px; padding: 0 0;" value="取消" onClick="location.replace('op.php?op=member&fp=account')">
										<input type=submit name=submit class="btn btn-success" style="height: 25px; width: 35px; padding: 0 0;" value="确定">
								</tr>

							</table>
						</form>
						</p></center>
				<tr>
					<td align=center class=td0 style="background-color: #005982;">
						{{L_REFRESHSEC}}<span id=pclock></span>
			</table>
		</div>
	</div>
</div>

<script>
function chk(f)
{
    f.submit.disabled = true;
    f.cancel.disabled = true;
	if (f.money.value=="") {
		alert("请输入下注金额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	var m = parseInt(f.money.value);
	if (m < {min}) {
		alert("下注金额不能小於最低限额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	if ({max} != -1 && m > {max}) {
		alert("下注金额不能大於最高限额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	if ({amount1} != -1 && m > {amount1}) {
		alert("下注金额不能超过单注限额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	if ({amount2} != -1 && {betamount} > {amount2}) { //原来 (m+{betamount})
		alert("下注金额不能超过下注限额！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	if ((m + {usedamount}) > {amount}) {
		alert("下注金额不能超过信用额度！");
		f.money.focus();
        f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
	if (!confirm("是否确定下注？")) {
		f.money.focus();
	    f.submit.disabled = false;
        f.cancel.disabled = false;
		return false;
	}
}

function calculate()
{
	if (f.money.value=="") {
		f.money.focus();
	} else {
		var money = parseFloat(f.money.value);
		var odds = parseFloat(document.all.odds.innerHTML);
		var payoff = Math.round(money*(odds-1));
		document.all.payoff.innerHTML = payoff;
	}
}

function canceldeliver()
{
	location.replace("?op=member&fp=account");
}

var RSecond=35;
RClockRate();

f.money.focus();
</script>